x86/shadow: account for ioreq server pages before complaining about not found mapping
authorJan Beulich <jbeulich@suse.com>
Mon, 2 May 2016 07:20:17 +0000 (09:20 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 2 May 2016 07:20:17 +0000 (09:20 +0200)
commit77eb5dbeff78bbe549793325520f59ab46a187f8
treef5d68880c76ffe3b8c8b8fb0b753cd4da4b6f812
parentc2994f8632d56e5379e612daa216401477dccbdb
x86/shadow: account for ioreq server pages before complaining about not found mapping

prepare_ring_for_helper(), just like share_xen_page_with_guest(),
takes a write reference on the page, and hence should similarly be
accounted for when determining whether to log a complaint.

This requires using recursive locking for the ioreq server lock, as the
offending invocation of sh_remove_all_mappings() is down the call stack
from hvm_set_ioreq_server_state(). (While not strictly needed to be
done in all other instances too, convert all of them for consistency.)

At once improve the usefulness of the shadow error message: Log all
values involved in triggering it as well as the GFN (to aid
understanding which guest page it is that there is a problem with - in
cases like the one here the GFN is invariant across invocations, while
the MFN obviously can [and will] vary).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
xen/arch/x86/hvm/ioreq.c
xen/arch/x86/mm/shadow/common.c
xen/include/asm-x86/hvm/ioreq.h